Char

class Char : Comparable<Char>

Represents a 16-bit Unicode character.

Types

Companion
Link copied to clipboard
object Companion

Functions

compareTo
Link copied to clipboard
open operator external override fun compareTo(other: Char): Int

Compares this value with the specified value for order.

dec
Link copied to clipboard
operator external fun dec(): Char

Decrements this value.

equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
fun equals(other: Char): Boolean
hashCode
Link copied to clipboard
open override fun hashCode(): Int
inc
Link copied to clipboard
operator external fun inc(): Char

Increments this value.

minus
Link copied to clipboard
inline operator fun minus(other: Char): Int

Subtracts the other Char value from this value resulting an Int.

inline operator fun minus(other: Int): Char

Subtracts the other Int value from this value resulting a Char.

plus
Link copied to clipboard
inline operator fun plus(other: Int): Char

Adds the other Int value to this value resulting a Char.

rangeTo
Link copied to clipboard
operator fun rangeTo(other: Char): CharRange

Creates a range from this value to the specified other value.

toByte
Link copied to clipboard
@DeprecatedSinceKotlin(warningSince = "1.5")
external fun toByte(): Byte

Returns the value of this character as a Byte.

toChar
Link copied to clipboard
inline fun toChar(): Char

Returns the value of this character as a Char.

toDouble
Link copied to clipboard
@DeprecatedSinceKotlin(warningSince = "1.5")
external fun toDouble(): Double

Returns the value of this character as a Double.

toFloat
Link copied to clipboard
@DeprecatedSinceKotlin(warningSince = "1.5")
external fun toFloat(): Float

Returns the value of this character as a Float.

toInt
Link copied to clipboard
@DeprecatedSinceKotlin(warningSince = "1.5")
external fun toInt(): Int

Returns the value of this character as a Int.

toLong
Link copied to clipboard
@DeprecatedSinceKotlin(warningSince = "1.5")
external fun toLong(): Long

Returns the value of this character as a Long.

toShort
Link copied to clipboard
@DeprecatedSinceKotlin(warningSince = "1.5")
external fun toShort(): Short

Returns the value of this character as a Short.

toString
Link copied to clipboard
open external override fun toString(): String

Extensions

category
Link copied to clipboard
expect val Char.category: CharCategory

Returns the Unicode general category of this character.

actual val Char.category: CharCategory

Returns the Unicode general category of this character.

actual val Char.category: CharCategory

Returns the Unicode general category of this character.

actual val Char.category: CharCategory

Returns the Unicode general category of this character.

code
Link copied to clipboard
val Char.code: Int

Returns the code of this Char.

digitToInt
Link copied to clipboard
fun Char.digitToInt(): Int

Returns the numeric value of the decimal digit that this Char represents. Throws an exception if this Char is not a valid decimal digit.

fun Char.digitToInt(radix: Int): Int

Returns the numeric value of the digit that this Char represents in the specified radix. Throws an exception if the radix is not in the range 2..36 or if this Char is not a valid digit in the specified radix.

digitToIntOrNull
Link copied to clipboard
fun Char.digitToIntOrNull(): Int?

Returns the numeric value of the decimal digit that this Char represents, or null if this Char is not a valid decimal digit.

fun Char.digitToIntOrNull(radix: Int): Int?

Returns the numeric value of the digit that this Char represents in the specified radix, or null if this Char is not a valid digit in the specified radix. Throws an exception if the radix is not in the range 2..36.

directionality
Link copied to clipboard
val Char.directionality: CharDirectionality

Returns the Unicode directionality property for the given character.

downTo
Link copied to clipboard
infix fun Char.downTo(to: Char): CharProgression

Returns a progression from this value down to the specified to value with the step -1.

equals
Link copied to clipboard
fun Char.equals(other: Char, ignoreCase: Boolean = false): Boolean

Returns true if this character is equal to the other character, optionally ignoring character case.

isDefined
Link copied to clipboard
expect fun Char.isDefined(): Boolean

Returns true if this character (Unicode code point) is defined in Unicode.

actual inline fun Char.isDefined(): Boolean

Returns true if this character (Unicode code point) is defined in Unicode.

actual fun Char.isDefined(): Boolean

Returns true if this character (Unicode code point) is defined in Unicode.

actual fun Char.isDefined(): Boolean

Returns true if this character (Unicode code point) is defined in Unicode.

isDigit
Link copied to clipboard
expect fun Char.isDigit(): Boolean

Returns true if this character is a digit.

actual inline fun Char.isDigit(): Boolean

Returns true if this character is a digit.

actual fun Char.isDigit(): Boolean

Returns true if this character is a digit.

actual fun Char.isDigit(): Boolean

Returns true if this character is a digit.

isHighSurrogate
Link copied to clipboard
expect fun Char.isHighSurrogate(): Boolean
actual inline fun Char.isHighSurrogate(): Boolean

Returns true if this character is a Unicode high-surrogate code unit (also known as leading-surrogate code unit).

actual fun Char.isHighSurrogate(): Boolean

Returns true if this character is a Unicode high-surrogate code unit (also known as leading-surrogate code unit).

actual external fun Char.isHighSurrogate(): Boolean

Returns true if this character is a Unicode high-surrogate code unit (also known as leading-surrogate code unit).

isIdentifierIgnorable
Link copied to clipboard
inline fun Char.isIdentifierIgnorable(): Boolean

Returns true if this character (Unicode code point) should be regarded as an ignorable character in a Java identifier or a Unicode identifier.

external fun Char.isIdentifierIgnorable(): Boolean

Returns true if this character (Unicode code point) should be regarded as an ignorable character in a Java identifier or a Unicode identifier.

isISOControl
Link copied to clipboard
expect fun Char.isISOControl(): Boolean

Returns true if this character is an ISO control character.

actual inline fun Char.isISOControl(): Boolean

Returns true if this character is an ISO control character.

actual fun Char.isISOControl(): Boolean

Returns true if this character is an ISO control character.

actual external fun Char.isISOControl(): Boolean

Returns true if this character is an ISO control character.

isJavaIdentifierPart
Link copied to clipboard
inline fun Char.isJavaIdentifierPart(): Boolean

Returns true if this character (Unicode code point) may be part of a Java identifier as other than the first character.

isJavaIdentifierStart
Link copied to clipboard
inline fun Char.isJavaIdentifierStart(): Boolean

Returns true if this character is permissible as the first character in a Java identifier.

isLetter
Link copied to clipboard
expect fun Char.isLetter(): Boolean

Returns true if this character is a letter.

actual inline fun Char.isLetter(): Boolean

Returns true if this character is a letter.

actual fun Char.isLetter(): Boolean

Returns true if this character is a letter.

actual fun Char.isLetter(): Boolean

Returns true if this character is a letter.

isLetterOrDigit
Link copied to clipboard
expect fun Char.isLetterOrDigit(): Boolean

Returns true if this character is a letter or digit.

actual inline fun Char.isLetterOrDigit(): Boolean

Returns true if this character is a letter or digit.

actual fun Char.isLetterOrDigit(): Boolean

Returns true if this character is a letter or digit.

actual fun Char.isLetterOrDigit(): Boolean

Returns true if this character is a letter or digit.

isLowerCase
Link copied to clipboard
expect fun Char.isLowerCase(): Boolean

Returns true if this character is a lower case letter.

actual inline fun Char.isLowerCase(): Boolean

Returns true if this character is lower case.

actual fun Char.isLowerCase(): Boolean

Returns true if this character is a lower case letter.

actual fun Char.isLowerCase(): Boolean

Returns true if this character is a lower case letter.

isLowSurrogate
Link copied to clipboard
expect fun Char.isLowSurrogate(): Boolean
actual inline fun Char.isLowSurrogate(): Boolean

Returns true if this character is a Unicode low-surrogate code unit (also known as trailing-surrogate code unit).

actual fun Char.isLowSurrogate(): Boolean

Returns true if this character is a Unicode low-surrogate code unit (also known as trailing-surrogate code unit).

actual external fun Char.isLowSurrogate(): Boolean

Returns true if this character is a Unicode low-surrogate code unit (also known as trailing-surrogate code unit).

isSurrogate
Link copied to clipboard
fun Char.isSurrogate(): Boolean

Returns true if this character is a Unicode surrogate code unit.

isTitleCase
Link copied to clipboard
expect fun Char.isTitleCase(): Boolean

Returns true if this character is a title case letter.

actual inline fun Char.isTitleCase(): Boolean

Returns true if this character is a title case letter.

actual fun Char.isTitleCase(): Boolean

Returns true if this character is a title case letter.

actual fun Char.isTitleCase(): Boolean

Returns true if this character is a title case letter.

isUpperCase
Link copied to clipboard
expect fun Char.isUpperCase(): Boolean

Returns true if this character is an upper case letter.

actual inline fun Char.isUpperCase(): Boolean

Returns true if this character is upper case.

actual fun Char.isUpperCase(): Boolean

Returns true if this character is an upper case letter.

actual fun Char.isUpperCase(): Boolean

Returns true if this character is an upper case letter.

isWhitespace
Link copied to clipboard
expect fun Char.isWhitespace(): Boolean

Determines whether a character is whitespace according to the Unicode standard. Returns true if the character is whitespace.

actual fun Char.isWhitespace(): Boolean

Determines whether a character is whitespace according to the Unicode standard. Returns true if the character is whitespace.

actual fun Char.isWhitespace(): Boolean

Determines whether a character is whitespace according to the Unicode standard. Returns true if the character is whitespace.

actual fun Char.isWhitespace(): Boolean

Determines whether a character is whitespace according to the Unicode standard. Returns true if the character is whitespace.

lowercase
Link copied to clipboard
expect fun Char.lowercase(): String

Converts this character to lower case using Unicode mapping rules of the invariant locale.

fun Char.lowercase(locale: Locale): String

Converts this character to lower case using Unicode mapping rules of the specified locale.

actual inline fun Char.lowercase(): String

Converts this character to lower case using Unicode mapping rules of the invariant locale.

actual inline fun Char.lowercase(): String

Converts this character to lower case using Unicode mapping rules of the invariant locale.

actual fun Char.lowercase(): String

Converts this character to lower case using Unicode mapping rules of the invariant locale.

lowercaseChar
Link copied to clipboard
expect fun Char.lowercaseChar(): Char

Converts this character to lower case using Unicode mapping rules of the invariant locale.

actual inline fun Char.lowercaseChar(): Char

Converts this character to lower case using Unicode mapping rules of the invariant locale.

actual inline fun Char.lowercaseChar(): Char

Converts this character to lower case using Unicode mapping rules of the invariant locale.

actual fun Char.lowercaseChar(): Char

Converts this character to lower case using Unicode mapping rules of the invariant locale.

plus
Link copied to clipboard
inline operator fun Char.plus(other: String): String

Concatenates this Char and a String.

titlecase
Link copied to clipboard
fun Char.titlecase(): String

Converts this character to title case using Unicode mapping rules of the invariant locale.

fun Char.titlecase(locale: Locale): String

Converts this character to title case using Unicode mapping rules of the specified locale.

titlecaseChar
Link copied to clipboard
expect fun Char.titlecaseChar(): Char

Converts this character to title case using Unicode mapping rules of the invariant locale.

actual inline fun Char.titlecaseChar(): Char

Converts this character to title case using Unicode mapping rules of the invariant locale.

actual fun Char.titlecaseChar(): Char

Converts this character to title case using Unicode mapping rules of the invariant locale.

actual fun Char.titlecaseChar(): Char

Converts this character to title case using Unicode mapping rules of the invariant locale.

toLowerCase
Link copied to clipboard
@DeprecatedSinceKotlin(warningSince = "1.5")
expect fun Char.toLowerCase(): Char

Converts this character to lower case using Unicode mapping rules of the invariant locale.

@DeprecatedSinceKotlin(warningSince = "1.5")
actual inline fun Char.toLowerCase(): Char

Converts this character to lower case using Unicode mapping rules of the invariant locale.

@DeprecatedSinceKotlin(warningSince = "1.5")
actual inline fun Char.toLowerCase(): Char

Converts this character to lower case using Unicode mapping rules of the invariant locale.

@DeprecatedSinceKotlin(warningSince = "1.5")
actual fun Char.toLowerCase(): Char

Converts this character to lower case using Unicode mapping rules of the invariant locale.

toTitleCase
Link copied to clipboard
@DeprecatedSinceKotlin(warningSince = "1.5")
inline fun Char.toTitleCase(): Char

Converts this character to title case using Unicode mapping rules of the invariant locale.

toUpperCase
Link copied to clipboard
@DeprecatedSinceKotlin(warningSince = "1.5")
expect fun Char.toUpperCase(): Char

Converts this character to upper case using Unicode mapping rules of the invariant locale.

@DeprecatedSinceKotlin(warningSince = "1.5")
actual inline fun Char.toUpperCase(): Char

Converts this character to upper case using Unicode mapping rules of the invariant locale.

@DeprecatedSinceKotlin(warningSince = "1.5")
actual inline fun Char.toUpperCase(): Char

Converts this character to upper case using Unicode mapping rules of the invariant locale.

@DeprecatedSinceKotlin(warningSince = "1.5")
actual fun Char.toUpperCase(): Char

Converts this character to upper case using Unicode mapping rules of the invariant locale.

until
Link copied to clipboard
infix fun Char.until(to: Char): CharRange

Returns a range from this value up to but excluding the specified to value.

uppercase
Link copied to clipboard
expect fun Char.uppercase(): String

Converts this character to upper case using Unicode mapping rules of the invariant locale.

fun Char.uppercase(locale: Locale): String

Converts this character to upper case using Unicode mapping rules of the specified locale.

actual inline fun Char.uppercase(): String

Converts this character to upper case using Unicode mapping rules of the invariant locale.

actual inline fun Char.uppercase(): String

Converts this character to upper case using Unicode mapping rules of the invariant locale.

actual fun Char.uppercase(): String

Converts this character to upper case using Unicode mapping rules of the invariant locale.

uppercaseChar
Link copied to clipboard
expect fun Char.uppercaseChar(): Char

Converts this character to upper case using Unicode mapping rules of the invariant locale.

actual inline fun Char.uppercaseChar(): Char

Converts this character to upper case using Unicode mapping rules of the invariant locale.

actual fun Char.uppercaseChar(): Char

Converts this character to upper case using Unicode mapping rules of the invariant locale.

actual fun Char.uppercaseChar(): Char

Converts this character to upper case using Unicode mapping rules of the invariant locale.